import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Plant from '../views/Plant.vue'
import Start from '../views/Start.vue'
import newHome from '../views/newHome.vue'
//import Search from '../views/Search.vue'
import global from '../views/global'
import MAP from '../views/map.vue'
const routes = [
  {
     path: '/',
      component:Start
  },
  {
    path: '/newHome',
     component:newHome
 },
 {
  path:'/map',
  component:MAP
 },
 {
   path:'/global',
   component:global
 },
  // {
  //   path:'/home',
  //   component:()=>import('../views/Home.vue')
    
  // },

  //   {
  //       path:'/test5',
  //       component:()=>import('../views/test5.vue')
  //   },
  //    {
  //       path:'/search',
  //       component:()=>import('../views/Search.vue')
  //     },
  //     {
  //      path:'/home',
  //      component:Home
  //    },
  //    {
  //     path:'/research',
  //     component:()=>import('../views/Research.vue')
  //   }, {
  //    path: '/about',
  //    name: 'About',
  //    component: () => import('../views/About.vue')
  //     },
 
  {
    path:'/plant',
    component:Plant,
    redirect:'/home',
    children:[
     {
        path:'/search',
        component:()=>import('../views/Search.vue')
      },
      {
       path:'/home',
       component:Home
     },
     {
      path:'/research',
      component:()=>import('../views/Research.vue')
    }, {
     path: '/about',
     name: 'About',
     component: () => import('../views/About.vue')
      },

    ]
  },
 

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
